Skip to content

update Schema resolution and casting - add explicit-object-schema and use-arbitrary-schema sys/env props#4868

Merged
frantuma merged 1 commit intomasterfrom
ticket-4798
Apr 1, 2025
Merged

update Schema resolution and casting - add explicit-object-schema and use-arbitrary-schema sys/env props#4868
frantuma merged 1 commit intomasterfrom
ticket-4798

Conversation

@frantuma
Copy link
Copy Markdown
Contributor

@frantuma frantuma commented Apr 1, 2025

This PR addresses the following tickets:

Changes include:

  • use correct Schema hierarchy for 3.0 and 3.1
  • update casting for 3.1
  • update object type resolution
  • introducing explicit-object-schema and use-arbitrary-schema sys/env props

These 2 properties allow to tweak the processing of Schema type. By default

  • for OAS 3.0 a type: object is added whenever any class (even java.lang.Object) is resolved into a schema and no type is defined in annotations or elsewhere. This behavior is unchanged (see below to customize) for compatibility reasons

  • for OAS 3.1 type: object is NOT added when type is not defined and there are not Object Schema-specific properties resolved for that schema.

this behavior can be customized by explicitly setting System/Env property explicit-object-schema to true (always add type:object in this scenario or false (don't add type: object)

Additionally, setting use-arbitrary-schema to true allows to customize deserialization behavior (see #4014) to deserialize schemas with no type defined into a ArbitrarySchema with type not defined instead of ObjectSchema with type: object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant